<template>
	<view class="liItem jc-between">
		<view :style="{backgroundImage: 'url('+coverImgUrl+')'}" class="musicCover" />
		<view class="rightInfo">
			<view class="title">{{name}}</view>
			<view class="dsc" v-if="trackCount||playCount"><text v-if="trackCount">{{trackCount}}首</text><text v-if="playCount">，播放{{playCount}}次</text></view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			coverImgUrl: {
				type: String,
				default: '/static/mine/none.png'
			},
			trackCount: {
				type: Number | String,
				require: true
			},
			playCount: {
				type: Number | String
			},
			name: {
				type: String,
				require: true
			}
		},
		data() {
			return {

			};
		}
	}
</script>

<style lang="scss">
	.liItem {

		>view {
			flex-shrink: 0;
		}

		.musicCover {
			@include bgRepeate('/static/mine/none.png');
			width: 46px;
			height: 46px;
			border-radius: 5px;
		}

		.rightInfo {
			flex: 1;
			display: flex;
			flex-direction: column;
			padding: 4px 10px;
			justify-content: center;
			overflow: hidden;

			>view {
				overflow: hidden;
				white-space: nowrap;
				text-overflow: ellipsis;
			}

			.title {
				font-size: 16px;
			}

			.dsc {
				font-size: 12px;
				color: #C0C0C0;
			}
		}
	}
</style>
